package com.attilax.web.es;

import static org.junit.Assert.*;

import java.io.IOException;
import java.util.Map;

import org.apache.log4j.Logger;
import org.junit.Test;

import com.alibaba.fastjson.JSON;
import com.google.common.collect.Maps;

import fulltxt.codescanner;

public class esUtilTest {
	static final Logger logger = Logger.getLogger(codescanner.class);
	@Test
	public final void testAddData() throws IOException {
		String url="http://192.168.1.18:9200/index_db_codelib/type1";
		String t="ttt";
		Map  m=Maps.newLinkedHashMap();m.put("txt", t);
		String r = esUtil.addData_post(url, JSON.toJSONString(m));
		logger.info(r);
		logger.info("--f");
	}

}
